<?php
include_once 'Administrador.php';
//include_once '../daos/AdministradorDao.php';
include_once 'daos/AdministradorDao.php';
class AdministradorUsuario{
	public	$admin;
	public	$admindao;
	public function __construct(){
		$this->admindao = new AdministradorDao();
		
	}
	public function autenticarUsuario($nick, $pass){
		$login = false;
		if(!(empty($nick))&&!(empty($pass))){
			$resulset = $this->admindao->autenticarUsuario($nick, $pass);
			if(sizeof($resulset)!=0){
				$this->admin = new Administrador();
				$this->admin->llenarAdministrador($resulset);
				return $this->admin;
			}else 
				return null;
		}else {
			return null;
		}
		return null;
	}
}	
//$p = new AdministradorUsuario();
//$r = $p->autenticarUsuario('prueba','a3696038ceffb0d2f9f2c058950bcc6d79fd5dfce0eec32bfd81a133b9b1ae03263dff895267b3d53ea6b4e1a0c022d046853a5a7e1fa6cae32ad0aa3e71611e');
//echo (isset($r)?"si":"no");
?>
